import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import plotly
plotly.offline.init_notebook_mode()
t = np.arange(0.0, 3.0, 0.01)
s = 1 + np.sin(3 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set(xlabel='time (s)', ylabel='voltage (mV)',
title='Simple graph made with matplotlib')
ax.grid()
plt.show()
import seaborn as sns
sns.set_theme(style="ticks")
diamonds = sns.load_dataset("diamonds")
f, ax = plt.subplots(figsize=(7, 5))
sns.despine(f)
sns.histplot(
diamonds,
x="price", hue="cut",
multiple="stack",
palette="light:m_r",
edgecolor=".3",
linewidth=.5,
log_scale=True,
)
ax.xaxis.set_major_formatter(mpl.ticker.ScalarFormatter())
ax.set_xticks([500, 1000, 2000, 5000, 10000])
ax.set_title('A histogram chart made with Seaborn');
import plotly.express as px
df = px.data.tips()
fig = px.pie(df, values='tip', names='day', title='Pie chart using Plotly')
fig.show()
import plotly.graph_objects as go
fig= go.Figure(data=go.Isosurface(
x=[0,0,0,0,1,1,1,1],
y=[1,0,1,0,1,0,1,0],
z=[1,1,0,0,1,1,0,0],
value=[1,2,3,4,5,6,7,8],
isomin=2,
isomax=6,
))
fig.update_layout(title="3D Isosurface Plot using Plotly")
fig.show()